<?php

class myUser extends sfBasicSecurityUser
{
    public function getUserMoodle(){
        if( isset( $_SESSION["USER"] ) ){
            return $_SESSION["USER"];
        }
        //return null;
        return 3;//usuario prueba
    }
    
    public function getStructureQuestion($type,$q,$structure){
        $dir_type = sfConfig::get("sf_lib_dir")."/question_type/".$type;
        if(is_dir($dir_type) ){
            include_once "{$dir_type}/{$type}_type_question.php";
            call_user_func("{$type}_build_structure",$q ,$structure);
        }else{
            echo "Error al cargar tipo de pregunta. ERROR: No existe plugins";
        }
        //$type_build_structure();
    }
    
    public function getTypeQuestionForm($type){
        $dir_type = sfConfig::get("sf_lib_dir")."/question_type/".$type;
        if(is_dir($dir_type) ){
            include_once "{$dir_type}/{$type}_type_question.php";
            call_user_func("{$type}_get_form_config",null ,null);
        }else{
            echo "Error al cargar tipo de pregunta. ERROR: No existe plugins";
        }
    }
    
    public function getTypeQuetions(){
        
    }
}
